<style type="text/css">
    .matrix-lable-left {
        text-align-last: left;
    }
</style>
<accordion>
    <accordion-group is-open="$ctrl.info.basic" is-disabled="isDisabled">
        <accordion-heading>
            基础内容
            <i class="pull-right fa fa-angle-right"
               ng-class="{'fa-angle-down': $ctrl.info.basic, 'fa-angle-right': !$ctrl.info.basic}"></i>
            <i class="fa fa-edit" ng-click="basicEdit()" title="编辑"
               ng-if="$ctrl.basicReadOnly&&(isSameOne||isAdmin)"></i>
        </accordion-heading>
        <!--可编辑模块-->
        <div class="col-sm-12 form-horizontal" ng-if="!$ctrl.basicReadOnly">
            <div class="form-group matrix-lable-left">
                <label class="col-sm-1 control-label">需求标题 <span style="color: red;">*</span>：</label>
                <div class="col-sm-2">
                    <input class="form-control ng-pristine ng-valid ng-empty ng-touched" placeholder="请输入需求标题..."
                           ng-disabled="$ctrl.pdRole" ng-model="$ctrl.need.title" aria-invalid="false" type="text">
                </div>
                <label class="col-sm-1 control-label">需求分类 <span style="color: red;">*</span>：</label>
                <div class="col-sm-2">
                    <m-ui-select prompt="请选择需求分类"
                                 itme-list="$ctrl.info.sources"
                                 selected-item="$ctrl.need.sltSource"
                                 has-disabled="$ctrl.pdRole"
                                 select-item-fun="selectSource(item)"
                    ></m-ui-select>
                </div>
                <div class="col-sm-6" ng-if="$ctrl.need.customers.show">
                    <label class="col-sm-2 control-label">客户名称 <span style="color: red;">*</span>：</label>
                    <div class="col-sm-10">
                        <m-ui-select class="col-sm-5"
                                     prompt="请选择客户"
                                     itme-list="$ctrl.need.customers.datas"
                                     selected-item="$ctrl.need.customers.selCustomer"
                                     has-disabled="$ctrl.pdRole"
                                     select-item-fun="selectCustomer(item)"
                        ></m-ui-select>
                    </div>
                    <label class="col-sm-2 control-label"></label>
                    <div class="  col-sm-6">
                        <label>
                            <input type="radio" name="customerType"
                                   value="super"
                                   ng-model="$ctrl.need.customerType"
                            >
                            大客户
                        </label>
                        <label>
                            <input type="radio" name="customerType"
                                   value="general"
                                   ng-model="$ctrl.need.customerType"
                            >
                            一般客户
                        </label>
                    </div>
                </div>

                <div ng-if="$ctrl.need.departments.show">
                    <label class="col-sm-1 control-label">需求部门 <span style="color: red;">*</span>：</label>
                    <div class="col-sm-2">
                        <m-ui-select prompt="请选择需求部门"
                                     itme-list="$ctrl.need.departments.datas"
                                     selected-item="$ctrl.need.departments.selDepartment"
                                     select-item-fun="selectDepartment(item)"
                                     has-disabled="$ctrl.pdRole">
                        </m-ui-select>
                    </div>
                </div>
                <div ng-if="$ctrl.need.workOrder.show">
                    <label class="col-sm-1 control-label">工单 <span style="color: red;">*</span>：</label>
                    <div class="col-sm-2">
                        <input ng-model="$ctrl.need.workOrder.ticketNumber">
                        <a><span>{{$ctrl.need.workOrder.content}}{{$ctrl.need.workOrder.ticketNumber}}</span></a>
                    </div>
                </div>
            </div>
            <div class="form-group matrix-lable-left">
                <label class="col-sm-1 control-label">提出人：</label>
                <label class="col-sm-2 control-label">{{$ctrl.need.sltCreator.realname ||
                    $ctrl.need.sltCreator.account}}</label>

                <label class="col-sm-1 control-label">提出日期：</label>
                <label class="col-sm-2 control-label">{{$ctrl.need.createTime | date: 'yyyy-MM-dd'}}</label>

                <label class="col-sm-1 control-label">受理人：</label>
                <label class="col-sm-2 control-label">{{$ctrl.need.acceptName}}</label>

            </div>
            <div class="form-group matrix-lable-left">
                <label class="col-sm-1 control-label">简&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述 <span
                        style="color: red;">*</span>：</label>
                <div class="col-sm-8">
                    <m-wysiwyg mhtml="$ctrl.need.needDesc" mid="noticePrototype" is-edit="false"
                               validate="false"></m-wysiwyg>
                </div>
            </div>
        </div>


        <!--只读模式-->
        <div class="col-sm-12 form-horizontal" ng-if="$ctrl.basicReadOnly">
            <div class="form-group matrix-lable-left">
                <label class="col-sm-1 control-label">需求标题 <span style="color: red;"></span>：</label>
                <label class="col-sm-2 control-label" readonly="basicReadOnly">{{$ctrl.need.title}}</label>
                <label class="col-sm-1 control-label">需求分类 <span style="color: red;"></span>：</label>
                <label class="col-sm-2 control-label" readonly="basicReadOnly">{{$ctrl.need.sltSource.crtname}}</label>
                <div class="col-sm-6" ng-if="$ctrl.need.customers.show">
                    <label class="col-sm-2 control-label">客户名称：</label>
                    <label class="col-sm-4 control-label" readonly="basicReadOnly">{{$ctrl.need.customers.selCustomer.crtname}}</label>
                    <div class="col-sm-6" ng-if="$ctrl.need.customers.show">
                        <label class="col-sm-4 control-label">客户类型：</label>
                        <label class="col-sm-4 control-label" readonly="basicReadOnly">{{$ctrl.need.customerType=="super"?"大客户":"一般客户"}}</label>
                    </div>
                </div>
                <div ng-if="$ctrl.need.departments.show">
                    <label class="col-sm-1 control-label">需求部门：</label>

                    <label class="col-sm-2 control-label" readonly="basicReadOnly">{{$ctrl.need.departments.selDepartment.crtname}}</label>
                </div>
                <div ng-if="$ctrl.need.workOrder.show">
                    <label class="col-sm-1 control-label">工单：</label>
                    <label class="col-sm-2 control-label" readonly="basicReadOnly">{{$ctrl.need.workOrder.content}}{{$ctrl.need.workOrder.ticketNumber}}</label>
                </div>
            </div>
            <div class="form-group matrix-lable-left">
                <label class="col-sm-1 control-label">提出人：</label>
                <label class="col-sm-2 control-label" readonly="basicReadOnly">{{$ctrl.need.sltCreator.realname ||
                    $ctrl.need.sltCreator.account}}</label>

                <label class="col-sm-1 control-label">提出日期：</label>
                <label class="col-sm-2 control-label" readonly="basicReadOnly">{{$ctrl.need.createTime | date: 'yyyy-MM-dd'}}</label>

                <label class="col-sm-1 control-label">&nbsp;&nbsp;受理人：</label>
                <label class="col-sm-2 control-label" readonly="basicReadOnly">{{$ctrl.need.acceptName}}</label>

            </div>
            <div class="form-group matrix-lable-left">
                <label class="col-sm-1 control-label">简&nbsp;&nbsp;&nbsp;&nbsp;述 ：</label>
                <div class="col-sm-8">
                    <m-wysiwyg mhtml="$ctrl.need.needDesc"
                               mid="noticePrototype"
                               is-edit="true"
                               validate="false"
                               id="req-desc"
                              >

                    </m-wysiwyg>
                </div>
            </div>
        </div>

        </div>
    </accordion-group>
</accordion>